package cn.yiufung.designPattern.decorator;

import java.math.BigDecimal;

/**
 * @author 姚锋
 * @createTime 2023年08月25日 14:14:00
 */
public abstract class AdditionItem implements FoodItem{

    private FoodItem foodItem;

    private BigDecimal price;

    public AdditionItem(FoodItem drick) {
        this.foodItem = drick;
    }

    protected BigDecimal getPrice() {
        return price;
    }

    protected void setPrice(BigDecimal price) {
        this.price = price;
    }

    protected FoodItem getFoodItem() {
        return foodItem;
    }

    protected void setFoodItem(FoodItem foodItem) {
        this.foodItem = foodItem;
    }

    @Override
    public BigDecimal showPrice() {
        return foodItem.showPrice().add(price);
    }
}
